<comment>只需要将getdate()函数里面的plandate换为相应的日期名称</comment>
<STYLE TYPE="text/css">
.normal{
    font-family: "Arial";
	font-size: 9pt;
	color: #666666;
	text-decoration: none;
}
.today {
    font-weight:bold;
	BACKGROUND: #f1f4fc;
    font-family: "Arial";
	font-size: 9pt;
	color: #666666;
	text-decoration: none;
}
.satday{
    font-family: "Arial";
	font-size: 9pt;
	color: #336600;
	text-decoration: none;
}
.sunday{
    font-family: "Arial";
	font-size: 9pt;
	color: #ff0000;
	text-decoration: none;
}
.days {font-weight:bold}
.title {
	font-family: "Arial";
	font-size: 10pt;
	text-decoration: blink;
	color: #FFFFFF;
}
.text {
	font-family: "Arial";
	font-size: 9pt;
	text-decoration: none;
}
.bord {
	border: 1px inset #666666;
}
.bordwu {
	border-top: none #666666;
	border-right: 3px double #666666;
	border-bottom: none #666666;
	border-left: 3px double #666666;
}
.text12 {
	font-family: "Times New Roman";
	font-size: 12pt;
	text-decoration: none;
}
.textarea {
	font-family: "Times New Roman", "Times", "serif";
	font-size: 10pt;
	border: 1px solid #666666;
	margin: 0px;
	height: 12px;
}
.width {
	width: 600px;
	border: 1px dashed #3399CC;
}
.bordwu {
	border: 1px none #ccddff;
	background-color: f1f4fc;
}

.area780 {
	width: 583px;
	border: 1px solid #CCCCCC;
	font-family: "Arial";
	font-size: 9pt;
	color: #666666;
	text-decoration: none;
	height: 18px;
}
.area200 {
	width: 200px;
	border: 1px solid #CCCCCC;
	font-family: "Arial";
	font-size: 9pt;
	color: #666666;
	height: 18px;
}
.area650 {
	width: 650px;
	border: 1px none #666666;
	font-family: "Arial";
	font-size: 9pt;
	color: #666666;
	text-decoration: none;
}
.area300 {
	width: 400px;
	border: 1px solid #CCCCCC;
	font-family: "Arial";
	font-size: 9pt;
	color: #666666;
	text-decoration: none;
}
.area10 {
	font-family: "Arial";
	font-size: 9pt;
	text-decoration: none;
	line-height: 18pt;
}
.area3 {
	border: 1px solid #CCCCCC;
	color: #666666;
	float: none;
	font-family: "Arial";
	font-size: 9pt;
	text-decoration: none;
	height: 18px;
	width: 154px;
}
.area2 {
	width: 257px;
	border: 1px solid #CCCCCC;
	font-family: "Arial";
	font-size: 9pt;
	color: #666666;
	text-decoration: none;
	height: 18px;
}
.area250 {
	width: 300px;
	border: 1px solid #CCCCCC;
	font-family: "Arial";
	font-size: 9pt;
	color: #666666;
	text-decoration:洀≥??楤? none;
}
.areaTM {
	border: none;
	font-family: "Arial";
	font-size: 9pt;
	color: #666666;
}
.area600 {
	font-family: "Arial";
	font-size: 9pt;
	color: #666666;
	width: 600px;
	border: none;
}
.tabtest {
	font-family: "Arial";
	font-size: 9pt;
	line-height: 12pt;
	text-decoration: none;
}
.area4wu {
	font-family: "Arial";
	font-size: 9pt;
	text-decoration: none;
	width: 100%;
	border: none;
	color: #666666;
}
.bord4c {
	border: 1px solid #CCCCCC;
}
.area4you {
	font-family: "Arial";
	font-size: 9pt;
	color: #666666;
	text-decoration: none;
	width: 100%;
	border: 1px solid #CCCCCC;
}
.area5zi {
	font-family: "Arial";
	font-size: 9pt;
	color: #666666;
	text-decoration: none;
	height: 18px;
	width: 5em;
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
//中文月份,如果想显示英文月份，修改下面的注释
/* var months = new Array("January", "February", "March",
"April", "May", "June", "July", "August", "September",
"October", "November", "December");*/
var months = new Array("一月", "二月", "三月",
"四月", "五月", "六月", "七月", "八月", "九月",
"十月", "十一月", "十二月");
var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31,
30, 31, 30, 31);
//中文周 如果想显示 英文的，修改下面的注释
/*var days = new Array("Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday", "Friday", "Saturday");*/
var days = new Array("日","一", "二", "三",
"四", "五", "六");
function getDays(month, year) {
//下面的这段代码是判断当前是否是闰年的
if (1 == month)
return ((0 == year % 4) && (0 != (year % 100))) ||
(0 == year % 400) ? 29 : 28;
else
return daysInMonth[month];
}

function getToday() {
//得到今天的年,月,日
this.now = new Date();
this.year = this.now.getFullYear();
this.month = this.now.getMonth();
this.day = this.now.getDate();
}


today = new getToday();

function newCalendar() {

today = new getToday();
var parseYear = parseInt(document.all.year
[document.all.year.selectedIndex].text);
var newCal = new Date(parseYear,
document.all.month.selectedIndex, 1);
var day = -1;
var startDay = newCal.getDay();
var daily = 0;
if ((today.year == newCal.getFullYear()) &&(today.month == newCal.getMonth()))
day = today.day;
var tableCal = document.all.hideBody.tBodies.dayList;
var intDaysInMonth =getDays(newCal.getMonth(), newCal.getFullYear());
for (var intWeek = 0; intWeek < tableCal.rows.length;intWeek++)
for (var intDay = 0;intDay < tableCal.rows[intWeek].cells.length;intDay++)
{
var cell = tableCal.rows[intWeek].cells[intDay];
if ((intDay == startDay) && (0 == daily))
daily = 1;
if(day==daily)
//今天，调用今天的Class
cell.className = "today";
else if(intDay==6)
//周六
cell.className = "satday";
else if (intDay==0)
//周日
cell.className ="sunday";
else
//平常
cell.className="normal";

if ((daily > 0) && (daily <= intDaysInMonth))
{
cell.innerText = daily;
daily++;
}
else
cell.innerText = "";
}
}

function getDate(dname) {
var sDate;
var yy = document.all.sj;
thedate=eval("document.all."+dname)
//这段代码处理鼠标点击的情况
if ("TD" == event.srcElement.tagName)
if ("" != event.srcElement.innerText)
{
if(document.all.month.value.length<2) bb="0"+document.all.month.value;
else bb=document.all.month.value;
if(event.srcElement.innerText.length<2) cc="0"+event.srcElement.innerText;
else cc=event.srcElement.innerText;
sDate = document.all.year.value + "-" + bb + "-" + cc;
if(yy.style.display=="inline"){
	hh = document.all.hour.value;
	mm = document.all.mini.value;
	ss = document.all.sec.value;
	sDate = sDate + " " + hh + ":" + mm + ":" + ss;
}
}
if (sDate==null)
{
alert('您还没有选择日期,请选择日期!');
}
else
{
thedate.value=sDate;
changetshow2();
}
}
function changeshow2(thename){

        var obj_span = document.all.span2;
        document.all.datename.value=thename.name;
        if(obj_span.style.display=="inline")
                obj_span.style.display="none";
        else
        		obj_span.style.display="inline";
}
function changetshow2()
{

        var obj_span = document.all.span2;
		var yy = document.all.sj;
        obj_span.style.display="none";
		yy.style.display="none";
		//obj_span.style.layer.z-index=999;
}
function changediv(tt)
{
  var daps  = document.all.span2.style;
  var ttop  = tt.offsetTop;     //TT控件的定位点高
  var thei  = tt.clientHeight;  //TT控件本身的高
  var tleft = tt.offsetLeft;    //TT控件的定位点宽
  var ttyp  = tt.type;          //TT控件的类型
  while (tt = tt.offsetParent){ttop+=tt.offsetTop; tleft+=tt.offsetLeft;}
  daps.top  = (ttyp=="image")? ttop+thei : ttop+thei+6; //层的 Y 坐标
  daps.left = tleft + 10;  //层的 X 坐标
}
function changeshow2Sj(thename){

        var obj_span = document.all.span2;
        document.all.datename.value=thename.name;
		var yy = document.all.sj;
        if(obj_span.style.display=="inline")
                obj_span.style.display="none";
        else
        		obj_span.style.display="inline";

        if(yy.style.display=="inline")
                yy.style.display="none";
        else
        		yy.style.display="inline";
}

</SCRIPT>
</HEAD>
<BODY ONLOAD="newCalendar()" OnUnload="window.returnValue = document.all.ret.value;" bgcolor="#FFFFFF">
<input type="hidden" name="ret">
<input type="hidden" name="datename">
<div id='span2' style="position:absolute;height:200px;width:200px;z-index=999;display:none;">
<iframe src="javascript:false" style="position:absolute; visibility:inherit; top:0px; left:0px; width:130px; height:141px; z-index:-1; filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';"></iframe>
<TABLE ID="calendar" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" border="0" style="border: 1px solid #CCCCCC;">
<TR id="sj" name="sj" style="display:none;">
<TD COLSPAN=7 ALIGN=CENTER>
<SELECT ID="hour" class=normal>
<SCRIPT LANGUAGE="JavaScript">
for (var intLoop = 0; intLoop < 24;
intLoop++){
	if(intLoop<10)
document.write("<OPTION VALUE= 0" + intLoop + " >0" +
intLoop + "时</OPTION>");
	else
document.write("<OPTION VALUE= " + intLoop  + ">" +
intLoop + "时</OPTION>");
}
</SCRIPT>
</SELECT>

<SELECT ID="mini" class=normal>
<SCRIPT LANGUAGE="JavaScript">
for (var intLoop = 0; intLoop < 60;
intLoop++){
	if(intLoop<10)
document.write("<OPTION VALUE= 0" + intLoop + " >0" +
intLoop + "分</OPTION>");
	else
document.write("<OPTION VALUE= " + intLoop  + ">" +
intLoop + "分</OPTION>");
}
</SCRIPT>
</SELECT>

<SELECT ID="sec" class=normal>
<SCRIPT LANGUAGE="JavaScript">
for (var intLoop = 0; intLoop < 60;
intLoop++){
	if(intLoop<10)
document.write("<OPTION VALUE= 0" + intLoop + " >0" +
intLoop + "秒</OPTION>");
	else
document.write("<OPTION VALUE= " + intLoop  + ">" +
intLoop + "秒</OPTION>");
}
</SCRIPT>
</SELECT>
</TD>
</TR>
<TR>
<TD COLSPAN=7 ALIGN=CENTER>
<SELECT ID="month" class=normal ONCHANGE="newCalendar();">
<SCRIPT LANGUAGE="JavaScript">
for (var intLoop = 0; intLoop < months.length;
intLoop++)
document.write("<OPTION VALUE= " + (intLoop + 1) + " " +
(today.month == intLoop ?
"Selected" : "") + ">" +
months[intLoop]);
</SCRIPT>
</SELECT>

<SELECT ID="year" class=normal ONCHANGE="newCalendar();">
<SCRIPT LANGUAGE="JavaScript">
	for (var intLoop = today.year-80; intLoop < (today.year +50);
	intLoop++)
	document.write("<OPTION VALUE= " + intLoop + " " +
	(today.year == intLoop ?
	"Selected" : "") + ">" +
	intLoop);
</SCRIPT>
</SELECT>
</TD>
</TR>
<TR CLASS="days">
<td>
<table id="hideBody">
<tr>
<SCRIPT LANGUAGE="JavaScript">
	
	document.write("<TD class=sunday>" + days[0] + "</TD>");
	for (var intLoop = 1; intLoop < days.length-1;
	intLoop++)
	document.write("<TD class=normal>" + days[intLoop] + "</TD>");
	document.write("<TD class=satday>" + days[intLoop] + "</TD>");
</SCRIPT>

</TR>
<TBODY border=1 cellspacing="0" cellpadding="0" ID="dayList" ALIGN=CENTER ONCLICK="getDate(document.all.datename.value)">
<SCRIPT LANGUAGE="JavaScript">
	for (var intWeeks = 0; intWeeks < 6; intWeeks++) {
	document.write("<TR style='cursor:hand'>");
	for (var intDays = 0; intDays < days.length;
	intDays++)
	document.write("<TD></TD>");
	document.write("</TR>");
	}
</SCRIPT>
</td>
</tr>
</table>
</TBODY>
</TABLE>
</div>